An industrial robot can be viewed as a chain of stiff links. Two links are joined to each other such that they are rotatable in relation to each other around a rotary axis. Each rotary axis is provided with a position transducer which measures the angle of rotation .theta..sub.i, where "i" stands for the axis number. The configuration of the robot is described by the angles of rotation of the axes. Normally, an industrial robot has five or six rotary axes. In the following, a six-axis robot will be described but, of course, the invention is applicable to robots having a larger or smaller number of axes as well. The final link in the chain consists of a tool which, depending on the field of application, may be, for example, a gripper, a glue gun, or a spot welding equipment.
The position and orientation of a robot tool in space is described by three position coordinates and three orientation components (X=x.sub.1. . . x.sub.6), while at the same time the arm configuration of the robot is described by angular coordinates (.theta.==.theta..sub.1. . . .theta..sub.6). The relationship between the coordinates of the tool and the angular coordinates of the robot may be described by means of a non-linear equation system and is usually called the kinematic equation of the robot: EQU X=F(.theta.) (1)
Equation (1) is normalized such that the position and orientation parts are comparable with respect to magnitude.
A common robot application means that the tool follows a given rectilinear path, for example during gluing or welding of a joint. In such applications it is normally important for the tool to follow the path precisely and without deviations. The path to be followed by the robot is determined by a plurality of consecutive points which indicate the coordinates of the tool in a reference coordinate system, for example the base coordinate system of the robot. For the robot to follow the path, the angles of rotation (.theta.) of the points on the path must be determined from equation system (1). The problem of calculating the angles of rotation of the robot based on given tool coordinates is called the inverse kinematic problem. By deriving the kinematic equations, a relationship between the speed of the tool and the angular velocities of the robot is obtained as follows: ##EQU1## For a six-axis robot the following applies: ##EQU2## is a 6.times.6 matrix of partial derivatives and is designated the Jacobian matrix.
For the equation system (3) to have a solution to all the robot configurations, the Jacobian matrix must be invertible for all .theta.. Most robots have one or more sets of .theta. for which the Jacobian matrix has no unambiguous solution, that is, the Jacobian is singular. The robot is then said to be in a singular configuration. At a singularity the configuration of the robot is such that two or more of the rotary axes of the robot coincide, which means that the robot has lost one or more of its degrees of freedom. At the singularity there is a direction in which the robot is unable to move regardless of the angular velocity chosen. For the robot to be able to pass near the singularity in this direction, a reconfiguration of the robot has to be made.
To be able to solve the inverse kinematic problem, numerical methods are being used today. However, these solutions do not particularly consider the singularities. One problem with the robots which are currently available on the market is that when the robot approaches a singularity, great reconfigurations of certain of the axes take place and these axes also attain very high axis velocities, and there is also a risk that the robot stops near the singularity.
For the robot to be able to follow a rectilinear path which passes through a singular point, two problems have to be solved. For one thing, the robot must detect that it approaches a singularity and, or another, it must be guided through the singularity such that the rectilinear path is followed. The passage through the singularity must not entail unnecessarily great reconfigurations of the axes.
U.S. Pat. No. 5,159,249 suggests a solution to the problem of detecting that the robot approaches a singularity, and of passing through the singularity without unnecessary reconfigurations of certain of the robot axes. The method comprises factorizing the Jacobian matrix, that is converting it into a product of several factors, wherein each of the factors may be inverted in a simple manner. The Jacobian matrix is factorized in such a way that one of the factors becomes a diagonal matrix. A diagonal matrix is inverted by inverting the diagonal elements. If any of the diagonal elements is smaller than a preset value, this is an indication that the robot approaches a singularity. On the basis of the diagonal elements which are smaller than this value, it is determined which axes run the risk of attaining high axis velocities and these axes are locked. When the axes are locked this means that the robot movement can only take place in certain directions.
The above method prevents the robot from stopping at the singularity, or from making considerable reconfigurations near the singularity. This is done at the expense of the position and orientation of the robot through the singularity. A disadvantage of this solution is that the robot cannot follow a given path through the singularity since the tool does not retain its position through the singularity.